package Solutions;

public class Solution2 {
    public static void main(String[] args) {
        String address="127.0.0.1";
        String s = defangIPadress(address);
        System.out.println(s);
    }
    public static String defangIPadress(String address) {
        String res = "";
        for (int i = 0; i < address.length(); i++) {
            if (address.charAt(i) == '.')
                res += "[.]";
            else
                res += address.charAt(i);
        }
        return res;
    }

}
